//一般直接写在一个js文件中
layui.use(['element','layer'],function () {
    var $ = layui.$;
    var layer = layui.layer;

    $(".sf").on('click',function(){
        var type = $(this).data("type");
        var elderlyId = $("#elderlyId").val();
        var elderlyName = $("#elderlyName").val();
        var elderlyIdNo = $("#elderlyIdNo").val();
        var curr = $("#curr").val();
        if(type == 3){
            layer.confirm('确定已收费?', function(index){
                location.href = "/settlement/paycash?elderlyId="+ elderlyId + "&curr=" + curr+ "&elderlyName=" + elderlyName+ "&elderlyIdNo=" + elderlyIdNo;
                layer.close(index);
            });
        }else if(type == 1){
            // location.href = "/settlement/payment?elderlyId="+ elderlyId + "&curr=" + curr+ "&elderlyName=" + elderlyName+ "&elderlyIdNo=" + elderlyIdNo;
            layer.open({
                title: '温馨提示'
                ,content: '尚未开通在线支付，无法使用此功能。联系电话 13572299477'
            });
        }
    });

    $("#send").on('click',function(){
    //     var elderlyId = $("#elderlyId").val();
    //     var elderlyName = $("#elderlyName").val();
    //     var orgId = $("#orgId").val();
    //     var curr = $("#curr").val();
    //     var orgName = $("#orgName").val();
    //
    //     $("#qrcode").empty();
    //     $("#qrcodeWrap > #info").empty();
    //     $("#qrcodeWrap > #info").text( "【结算账单】-" +elderlyName+"-"+ orgName);
    //     var qrcode = new QRCode('qrcode', {
    //         text: 'https://www.kerry365.com/settlement/out_pay?elderlyId=' + elderlyId +'&curr=' + curr + '&orgId='+ orgId,
    //         width: 256,
    //         height: 256,
    //         colorDark : '#000000',
    //         colorLight : '#ffffff',
    //         correctLevel : QRCode.CorrectLevel.H
    //     });
    //     var index = layer.open({
    //         title:'发送账单(截图发送至微信)',
    //         type: 1,
    //         content: $('#qrcodeWrap')
    //     });
        layer.open({
            title: '温馨提示'
            ,content: '尚未开通远程支付，无法使用此功能。联系电话 13572299477'
        });
    });
});
